import 'dart:convert';

class FolderInfoEntity {
  // 文件夹名称
  final String folderName;

  // 子文件数量
  final int count;

  // 文件夹路径ID
  final String pathId;

  // 构造函数
  FolderInfoEntity({
    required this.folderName,
    required this.count,
    required this.pathId,
  });

  // 从JSON字符串转换
  factory FolderInfoEntity.fromJsonString(String jsonString) {
    final Map<String, dynamic> json = jsonDecode(jsonString);
    return FolderInfoEntity(
      folderName: json['folderName'],
      count: json['count'],
      pathId: json['pathId'],
    );
  }

  // 转换为JSON字符串
  String toJsonString() {
    return jsonEncode({
      'folderName': folderName,
      'count': count,
      'pathId': pathId,
    });
  }
}
